﻿using UnityEngine;
using System.Collections;

public class TweenNguiColor : TweenBase {
	public Color _start;
	public Color _end;

	public UIWidget _cachedWidget;

	// Use this for initialization
	protected override void Init () {
		_cachedWidget = GetComponent<UIWidget>();
	}

	// Update is called once per frame
	protected override void Lerp () {
		Color color = Color.Lerp (_start, _end, (Time.time - _savetime) / _time);
		_cachedWidget.color = color;
	}
	protected override void PlayRest(){
		Color color = Color.Lerp (_start, _end, (Time.time - _savetime) / _time);
		_cachedWidget.color = color;
	}
}
